
#region using statements

using NGen;
using NGen.Managers.Audio;
using NGen.Managers.Collision;
using NGen.Managers.GUI;
using NGen.Managers.GameObject;
using NGen.Managers.GameState;
using NGen.Managers.Input;
using NGen.Managers.Pathfinding;

using Psych.States;
using Microsoft.Xna.Framework;
using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
#endregion

namespace Psych
{
    internal static class Program
    {
        /*private AnimatedTexture SpriteTexture;
        private const float Rotation = 0;
        private const float Scale = 2.0f;
        private const float Depth = 0.5f;
        public TimeSpan TargetElapsedTime { get; set; }

        private GraphicsDeviceManager graphics;
        private ContentManager Content;
        private Viewport viewport;
        private Vector2 shipPos;
        private const int Frames = 4;
        private const int FramesPerSec = 2;
        */
        /// <summary>
        /// 	The main entry point for the Game.
        /// </summary>
        private static void Main()
        {
            using (var game = new GameEngine())
            {
                game.IsMouseVisible = true;

                //set the resolution
                GameEngine.GraphicsDeviceManager.PreferredBackBufferWidth = 800;
                GameEngine.GraphicsDeviceManager.PreferredBackBufferHeight = 600;

                SetupManagers();

                //we want to start in the menu state
                GameEngine.GetService<IManagerGameState>().StartingState = new GameStateMenu();

                game.Run();
            }
        }

        /// <summary>
        /// 	Creats the managers, register them as services, add them to the
        /// 	game engine to be automatically updated
        /// </summary>
        private static void SetupManagers()
        {
            GameEngine.GameServices.AddService(typeof(IManagerGameState), new ManagerGameState());
            GameEngine.AddManager(GameEngine.GetService<IManagerGameState>());
            GameEngine.GameServices.AddService(typeof(IManagerAudio2D), new ManagerAudio2D());
            GameEngine.AddManager(GameEngine.GetService<IManagerAudio2D>());
            GameEngine.GameServices.AddService(typeof(IManagerGameObjects), new ManagerGameObjects());
            GameEngine.AddManager(GameEngine.GetService<IManagerGameObjects>());
            GameEngine.GameServices.AddService(typeof(IManagerGUI), new ManagerGUI());
            GameEngine.AddManager(GameEngine.GetService<IManagerGUI>());
            GameEngine.GameServices.AddService(typeof(IManagerInput), new ManagerInput());
            GameEngine.AddManager(GameEngine.GetService<IManagerInput>());
            GameEngine.GameServices.AddService(typeof(IManagerCollision2D), new ManagerCollision2D());
            GameEngine.AddManager(GameEngine.GetService<IManagerCollision2D>());
            GameEngine.GameServices.AddService(typeof(IManagerPathfinding), new ManagerPathfinding());
        }

        /*
        private void SetupSprites()
        {
            SpriteTexture = new AnimatedTexture(Vector2.Zero, Rotation, Scale, Depth);
            
            // Set device frame rate to 30 fps.
            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
        }


        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            SpriteBatch spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            // "shipanimated" is the name of the sprite asset in the project.
            SpriteTexture.Load(graphics.GraphicsDevice, Content, "shipanimated", Frames, FramesPerSec);
            viewport = graphics.GraphicsDevice.Viewport;
            shipPos = new Vector2(viewport.Width / 2, viewport.Height / 2);
        }

        protected override void Update(GameTime gameTime)
        {
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

            // TODO: Add your game logic here.
            SpriteTexture.UpdateFrame(elapsed);
            base.Update(gameTime);
        }*/


    }
}


